<%@ include file="/common/taglibs.jsp"%>
<c:set var="toPayOrderUrl"><spring:url value="/order/orderDetailsInfo.html"/></c:set>
<head>
	<script type="text/javascript">
	$(function(){
		$("#toPayOrder").click(function(){
			location.assign("${toPayOrderUrl}");
		});
	});
	</script>

</head>
<h3><spring:message code="sub.category"/></h3>
<c:set var="sidebarCategoriesUrl"><spring:url value="/main.html">
	<spring:param name="selectedCategoryId" value=""/>
	</spring:url></c:set>
<st:sidebarCategories root="${sidebarCategory}" uri="${sidebarCategoriesUrl}" 
	selectedCategoryId="${selectedCategoryId}" id="sidebarmenu1"/>
<p></p>
<h3><spring:message code="sub.shoppingCart" /></h3>
<table class="shoppingCart" >
	<c:forEach var="item" items="${shoppingCart.shoppingCartItems}">
		<tr>
			<td><a href="<spring:url value='/book/details.html'>
				<spring:param name="bookId" value="${item.book.id}"/>
			</spring:url>"><st:bookDescription text="${item.book.name}" length="20"/></a></td>
			<td>$<c:out value="${item.totalPrice}" /></td>
		</tr>
	</c:forEach>
	<tr>
		<td><spring:message code="sub.shoppingCart.total.quantity" arguments="${shoppingCart.totalQuantity}"/></td>
		<td>$<c:out value="${shoppingCart.totalPrice}"/></td>
	</tr>
</table>
<a href="<spring:url value='/shoppingCart/shoppingCart.html'/>"><spring:message code="sub.shoppingCart.more"/></a>
<c:choose>
	<c:when test="${fn:length(shoppingCart.shoppingCartItems) == 0}">
		<button id="toPayOrder" class="aButton" disabled="disabled" style="float: right; margin-right: 10px;"><spring:message code="shoppingCart.pay"/></button>
	</c:when>
	<c:otherwise>
		<button id="toPayOrder" class="aButton" style="float: right; margin-right: 10px;"><spring:message code="shoppingCart.pay"/></button>
	</c:otherwise>
</c:choose>
<p></p>
<h3><spring:message code="sub.search.header"/></h3>
<form action="<spring:url value='/search.html'/>" method="post">
	<table>
		<tr>
			<td><input type="text" name="keyWord"/><input type="hidden" name="pageNo" value="1"/></td>
		</tr>
		<tr>
			<td><button class="aButton"><spring:message code="sub.search"/></button></td>
		</tr>
	</table>
</form>




